package com.wfs.common.wechat;

import org.weixin4j.Configuration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 赵飞
 * @version V1.0
 * @Title:
 * @Package ${PACKAGE_NAME}
 * @Description:
 * @date 2017/3/29
 */
public class AuthServlet extends HttpServlet {
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//运营者开始进行公众号授权
		String auth_code =request.getParameter("auth_code");
		String expires_in = request.getParameter("expires_in");

		if (Configuration.isDebug()) {
			System.out.println("获得公众号授权auth_code:" + auth_code);
			System.out.println("过期时间:" + expires_in);
		}

		//根据code 换取openId
	}
}
